package com.vanpos.service.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vanpos.dao.user.OperatorUserDao;
import com.vanpos.domain.user.OperatorUser;

@Service
public class OperatorUserService {
	@Autowired
	private OperatorUserDao operatorUserDao;
	
	/**
	 * 验证登录名、密码是否匹配
	 * @param loginName
	 * @param password
	 * @return
	 */
	public boolean getMatchCount(String loginName, String password){
		int matchCount = operatorUserDao.getMatchCount(loginName, password);
		return matchCount > 0;
	}
	
	/**
	 * 通过登录名查询后台用户信息
	 * @param loginName
	 * @return
	 */
	public OperatorUser findUserByLoginName(String loginName){
		return operatorUserDao.findUserByLoginName(loginName);
	}
}
